local weaponDefs = {
  C_MACHINEGUN = {
    name                    = "Machine Gun",
    weaponType              = "LaserCannon",
    turret                  = true,
    impactOnly              = true,
    noSelfDamage            = true,
    collideFriendly         = false,
    --avoidFriendly           = false,
	  --avoidFeature            = false,
	  --canAttackGround         = false,
	
    duration                = 0.01,
    thickness               = 0.5,
    coreThickness           = 0.0,	
    rgbColor                = [[1 0.6 0]],
    rgbColor2               = [[1 1 1]],	
    intensity               = 0.8,
    --LaserFlareSize

    range                   = 370,
    heightMod               = 0.7,	--verticalRange 529
    reloadTime              = 1.7,
    burst                   = 6,
    burstRate               = 0.1,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0,
    impulseBoost            = 0,

    weaponVelocity          = 750,  --~900m/s irl  --NOTA:1000
    accuracy                = 300,
    movingAccuracy          = 400,
    sprayAngle              = 400,  --512
    predictBoost            = 0.9,
    proximityPriority       = 2.0,
    tolerance               = 1000,  --6000, 10000
    --weaponTimer             = 1,	
	
    soundStart              = "ratatat",
    soundHit                = "softblat",
    soundtrigger            = false,	

    --explosionGenerator      = "custom:LIGHTARMS",

    damage = {
      default = 5,  --DPS: 5 * 6 / 1.7 = 18
    },

    customParams = {
      armorPenetration = 10,
      
      badTargetCategory  = [[WEAK_ARMOR]],
      onlyTargetCategory = [[PLANE HELICOPTER WEAK_ARMOR]],      
    },
  },
  
  
  C_CANNON_AUTOCANNON_1BARREL = {
    name                    = "Autocannon",
    weaponType              = "LaserCannon",
    turret                  = true,
    impactOnly              = true,
    noSelfDamage            = true,
    collideFriendly         = false,
	
    duration                = 0.01,
    thickness               = 0.7,
    coreThickness           = 0.0,	
    rgbColor                = [[1 0.6 0]],
    rgbColor2               = [[1 1 1]],	
    intensity               = 0.8,

    range                   = 450,
    heightMod               = 0.8,	--verticalRange 563
    reloadTime              = 0.3,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0,
    impulseBoost            = 0,

    weaponVelocity          = 750,  --~800-1100m/s irl
    accuracy                = 300,
    movingAccuracy          = 400,
    --sprayAngle              = 256,
    predictBoost            = 0.9,
    proximityPriority       = 2.0,
    tolerance               = 1000,
	
    soundStart              = "ratatat",
    soundHit                = "emg_hit", --"softblat",
    --soundtrigger            = false,	

    damage = {
      default = 10,  --DPS: 10 / 0.3 = 33
    },

    customParams = {
      armorPenetration = 30,

      badTargetCategory  = [[BUILDING TANK SHIP]],
      onlyTargetCategory = [[BUILDING TANK SHIP PLANE HELICOPTER]],
      
      numberOfBarrels  = 1,
    },
  },
  
  
  C_CANNON_AA_1BARREL = {
    name                    = "Light Flak Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = false, --
    myGravity               = 0.1,    
    burnBlow                = true,    
    noSelfDamage            = true,
    avoidFriendly           = true,    
	  --canAttackGround         = false, --for testing
	
    rgbColor                = [[0.7 0.7 0.7]],
    intensity               = 1.0,

    range                   = 550,
    heightMod               = 0.8,	--verticalRange 688
    reloadTime              = 1.3,
    areaOfEffect            = 64,
    edgeEffectiveness       = 0.2,    
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0,
    impulseBoost            = 0,

    weaponVelocity          = 800,  --~600-800m/s irl
    accuracy                = 800,
    movingAccuracy          = 1000,
    predictBoost            = 0.7,
    proximityPriority       = 2.0,
	
    soundStart              = "canlite2",
    soundHit                = "flakhit",

    damage = {
      default = 40,  --DPS: 40 / 1.3 = 31
    },

    customParams = {
      armorPenetration = 30,
  
      onlyTargetCategory = [[PLANE HELICOPTER]],
  
      numberOfBarrels  = 1,
      barrelsPenalty   = 0.5,
    },
  },
 
 
  C_CANNON_AA_MEDIUM_1BARREL = {
    name                    = "Medium Flak Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = false, --
    myGravity               = 0.1,    
    burnBlow                = true,    
    noSelfDamage            = true,
    avoidFriendly           = true,    
	  --canAttackGround         = false, --for testing
	
    rgbColor                = [[0.7 0.7 0.7]],
    intensity               = 1.0,

    range                   = 700,
    heightMod               = 0.8,	--verticalRange 875
    reloadTime              = 1.5,
    areaOfEffect            = 96,
    edgeEffectiveness       = 0.2,    
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0,
    impulseBoost            = 0,

    weaponVelocity          = 800,  --~900m/s irl
    accuracy                = 600,
    movingAccuracy          = 750,
    predictBoost            = 0.7,
    proximityPriority       = 1.0,
	
    soundStart              = "canlite2",
    soundHit                = "flakhit",

    damage = {
      default = 100,  --DPS: 100 / 1.5 = 66
    },

    customParams = {
      armorPenetration = 60,

      --badTargetCategory  = [[LOW_ALTITUDE]],
      onlyTargetCategory = [[PLANE HELICOPTER]],
      
      numberOfBarrels  = 1,
      barrelsPenalty   = 0.5,
    },
  },
  
  
  C_CANNON_AA_HEAVY = {
    name                    = "Heavy Flak Cannon",
    weaponType              = "Cannon",
    --model                   = "armstump_dead.3do", --"c_lighttank.s3o",
    turret                  = true,
    gravityAffected         = false, --
    myGravity               = 0.1,
    burnBlow                = true,
    noSelfDamage            = true,
    --collideFriendly         = false,
    avoidFriendly           = true,
	  --canAttackGround         = false, --for testing
    --toAirWeapon             = true,
    --onlyTargetCategory
	
    rgbColor                = [[0.7 0.7 0.7]],
    intensity               = 1.0,

    range                   = 850,  --ZK:1000  BA:680-775  NOTA:1250-2000
    heightMod               = 0.8,	--verticalRange 1063
    --cylinderTargetting      = 1,
    reloadTime              = 0.8,  --rpm 85-120 0.5-0.7  --70rounds  --ZK:0.5  BA:0.55-0.75  NOTA:0.25-2.4 (0.6-1.2) 
    areaOfEffect            = 96,   --ZK:128  BA:128-192  NOTA: 80-125
    edgeEffectiveness       = 0.2,  --ZK:0.5  BA:0.85  NOTA:0.3-0.9 
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0,
    impulseBoost            = 0,

    weaponVelocity          = 850,  --~700m/s irl  --ZK:2000  BA:1500-2450  NOTA:950-1065
    --weaponTimer             = 1,
    accuracy                = 300,  --ZK:500  BA:1000  NOTA:1200-1850 (sprayAngle)
    movingAccuracy          = 400,
    predictBoost            = 0.8,  --0.6-1
    proximityPriority       = 1.0,
    --tolerance               = 1000,  --NOTA:767
	
    soundStart              = "canlite2",
    soundHit                = "xplosml1",  --"flakhit",
    
    explosiongenerator      = "custom:FLASH3",

    damage = {
      default = 130,  --DPS: 130 / 0.8 = 163
    },

    customParams = {
      armorPenetration = 90,
      
      badTargetCategory  = [[BUILDING TANK SHIP]],
      onlyTargetCategory = [[BUILDING TANK SHIP PLANE HELICOPTER]],
    },
  },
}
  
--cegTag                  = "flak_trail",
--explosionGenerator      = "custom:FLAK_HIT_24",
--explosiongenerator = "custom:FLASH3",
--explosiongenerator = "custom:FLAK_BURST_Expl",  
--explosiongenerator = "custom:FLAK_SMALLBURST_Expl",
--explosiongenerator = "custom:FLAK_SMALLWHITEBURST_Expl",

local newWeaponDef = Shared.copyTable(weaponDefs["C_CANNON_AA_1BARREL"])
  newWeaponDef.name           = "Cluster Light Flak Cannon"
  newWeaponDef.range          = 450  --verticalRange 563
  newWeaponDef.reloadTime     = 1.7
  newWeaponDef.projectiles    = 7
  newWeaponDef.weaponVelocity = 700
  newWeaponDef.accuracy       = 1000
  newWeaponDef.movingAccuracy = 1250
  newWeaponDef.sprayAngle     = 2000
  newWeaponDef.predictBoost   = 0.6
weaponDefs["C_CANNON_AA_CLUSTER"] = newWeaponDef  --DPS: 7 * 40 / 1.6 = 175

Shared.weaponDefs = weaponDefs
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_AUTOCANNON_2BARRELS",        "Double Autocannon", 2, "C_CANNON_AUTOCANNON_1BARREL", 0.005)  --DPS: 2 * 10 / 0.3 = 67
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_AA_2BARRELS",         "Double Light Flak Cannon", 2, "C_CANNON_AA_1BARREL")
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_AA_3BARRELS",         "Triple Light Flak Cannon", 3, "C_CANNON_AA_1BARREL")
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_AA_4BARRELS",      "Quadruple Light Flak Cannon", 4, "C_CANNON_AA_1BARREL")
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_AA_6BARRELS",       "Sextuple Light Flak Cannon", 6, "C_CANNON_AA_1BARREL")
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_AA_MEDIUM_2BARRELS", "Double Medium Flak Cannon", 2, "C_CANNON_AA_MEDIUM_1BARREL")

return lowerkeys(weaponDefs)